﻿using AG.Apps.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;

namespace AG.Apps.WebServices
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IAdRotatorService
    {

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/GetAds/{appCode}/{language}", 
            RequestFormat = WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json, 
           BodyStyle= WebMessageBodyStyle.Bare )]
        List<Ad> GetAds(string appCode, string language);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/GetAdsByLocation/{appCode}/{language}?l={location}",
            RequestFormat = WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json,
           BodyStyle = WebMessageBodyStyle.Bare)]
        List<Ad> GetAdsByLocation(string appCode, string language, int location);


        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/GetAds/{appCode}/{language}?u={userName}&h={hostWebUrl}&p={appPage}",
            RequestFormat = WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json,
           BodyStyle = WebMessageBodyStyle.Bare)]
        List<Ad> GetAdsWithAnalytics(string appCode, string language, string userName, string hostWebUrl, string appPage);

        
        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/Analytics/{appCode}/{language}?u={userName}&h={hostWebUrl}&p={appPage}",
            RequestFormat = WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json,
           BodyStyle = WebMessageBodyStyle.Bare)]
        void SetAnalytics(string appCode, string language, string userName, string hostWebUrl, string appPage);


    }


   
}
